/*
#################################################################
# "Democracy, Inequality and Antitrust"                         #
#   By Michael O Allen, Kenneth Scheve, and David Stasavage     #
#                                                               #
#   This file:                                                  #
#   Replication code for Figure E1 						        #
#                                                               #
#   Last modified: 12/18/2024                                   #
#################################################################
*/

cd "/Users/moda/Desktop/democracy inequality antitrust jop"
use "data/cli_p3.dta", clear

xtset cid p3

// PARALLEL TRENDS
xtreg p3_CLI_DV F(2/-2)(i.dem_trans##i.top1Share_per_shock) gdppc_lag1_ln trade_openness_lag1 crisis_3_percent_lag1 i.p3 if top1_n >= 20, fe vce(cl cid)
est store p3_lags_leads_loglog
estadd local years "1951+"
estadd local fe_unit "Yes"
estadd local controls "Yes"

coefplot, nolabel drop(0*) keep(*dem_trans) omitted vertical ci(90) yline(0)  ///
	xlabel(, labsize(large)) ytitle(, size(large)) ///
	ylabel(, labsize(large)) ytitle(, size(large)) ///
	title(Democracy, size(large)) ///
	ciopts(lwidth(.75) msize(4)) ///
	msize(2) msymbol(dot) ///
	rename(1F2.dem_trans = "t-2" ///
		   1F.dem_trans = "t-1" ///
		   1.dem_trans = "t" ///
		   1L.dem_trans = "t+1" ///
		   1L2.dem_trans = "t+2")
		   
graph export "output/figures/figure-e1a.eps", replace
		   
coefplot, nolabel drop(0* *dem*) keep(*top1Share_per_shock) omitted vertical ci(90) yline(0)  ///
	xlabel(, labsize(large)) ytitle(, size(large)) ///
	ylabel(, labsize(large)) ytitle(, size(large)) ///
	title("Top 1% Share", size(large)) ///
	ciopts(lwidth(.75) msize(4)) ///
	msize(2) msymbol(dot) ///
	rename(1F2.top1Share_per_shock = "t-2" ///
		   1F.top1Share_per_shock = "t-1" ///
		   1.top1Share_per_shock = "t" ///
		   1L.top1Share_per_shock = "t+1" ///
		   1L2.top1Share_per_shock = "t+2")
		   
graph export "output/figures/figure-e1b.eps", replace
		   
coefplot, nolabel drop(0*) ///
	keep(1F2.dem_trans#1F2.top1Share_per_shock ///
		 1F.dem_trans#1F.top1Share_per_shock ///
		 1.dem_trans#1.top1Share_per_shock ///
		 1L.dem_trans#1L.top1Share_per_shock ///
		 1L2.dem_trans#1L2.top1Share_per_shock ///
	) omitted vertical ci(90) yline(0)  ///
	xlabel(, labsize(large)) ytitle(, size(large)) ///
	ylabel(, labsize(large)) ytitle(, size(large)) ///
	title("Top 1% Share x Democracy", size(large)) ///
	ciopts(lwidth(.75) msize(4)) ///
	msize(2) msymbol(dot) ///
	rename(1F2.dem_trans#1F2.top1Share_per_shock = "t-2" ///
		   1F.dem_trans#1F.top1Share_per_shock = "t-1" ///
		   1.dem_trans#1.top1Share_per_shock = "t" ///
		   1L.dem_trans#1L.top1Share_per_shock = "t+1" ///
		   1L2.dem_trans#1L2.top1Share_per_shock = "t+2")

graph export "output/figures/figure-e1c.eps", replace
